package chain;

public class HandlerA implements Handler{

    private Handler next;

    @Override
    public void setNext(Handler handler) {
        this.next = handler;
    }

    @Override
    public void handle(Request request) {
        System.out.println("handlerA开始处理："+request.getData());
        request.setData(request.getData().toUpperCase());
        System.out.println("handlerA处理结果为："+request.getData());
        if (next != null){
            next.handle(request);
        }else{
            System.out.println("handler末端，处理结束");
        }
    }
}
